#include <cstdio>
#include <cmath>
int main()
{
	
	freopen("zz_test\\test1.in", "r", stdin);
	freopen("zz_test\\test1.out", "w", stdout);
	int k = 0;
	scanf("%d", &k);
	int n = 2;
	
	int i = 0;
	while ( i < k ) 
	{
		int ret = 1;
		for ( int j = 2; j <= sqrt(n); j++ ) 
		{
			if ( n % j == 0 ) {
				ret = 0;
				break;
			}
		}
		if ( ret == 1 ) {
			i ++;
		}
		if ( i < k ) {
			n ++;
		}		
	}
	printf("%d", n);
	return 0;
} 
